//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mapper;

import com.example.entity.Admin;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface AdminMapper {
    List<Admin> selectAll(Admin admin);

    @Select({"select * from admin where id = #{id}"})
    Admin selectById(Integer id);

    @Insert({"insert into admin (username,password,name,role,avatar,phone) values (#{username},#{password},#{name},#{role},#{avatar},#{phone})"})
    int insert(Admin admin);

    @Update({"update admin set username = #{username}, password= #{password},name = #{name},role = #{role},avatar = #{avatar},phone=#{phone} where id=#{id}"})
    int updateById(Admin admin);

    @Delete({"delete from admin where id = #{id}"})
    int deleteById(Integer id);

    @Select({"select * from admin where username = #{username}"})
    Admin selectByUsername(String username);
}
